import request from "@/api/request"

import { rolesApis } from "./apis"
import type { AxiosResponse } from 'axios'
import type { CommonRes } from '@/api/user/types.ts'


export const rolesApi = {
    listRoles(params: any) {
      return request({
        url: rolesApis.ListRoles,
        method: 'post',
        data: params,
      })
    },
    getRoles(params: any) {
      return request({
        url: rolesApis.GetRoles,
        method: 'post',
        data: params,
      })
    },
    addRoles(params: any) {
      return request({
        url: rolesApis.AddRoles,
        method: 'post',
        data: params,
      })
    },
    updateRoles(params: any) {
      return request({
        url: rolesApis.UpdateRoles,
        method: 'post',
        data: params,
      })
    },
    deleteRoles(params: any) {
      return request({
        url: rolesApis.DeleteRoles,
        method: 'post',
        data: params,
      })
    },
    listRolesPermissions(params: any) {
      return request({
        url: rolesApis.ListRolesPermissions,
        method: 'post',
        data: params,
      })
    },
    updateRolesPermissions(params: any) {
      return request({
        url: rolesApis.UpdateRolesPermissions,
        method: 'post',
        data: params,
      })
    },
    deleteRolesPermissions(params: any): Promise<AxiosResponse<CommonRes<boolean>>> {
      return request({
        url: rolesApis.DeleteRolesPermissions,
        method: 'post',
        data: params,
      })
    },
}
